package com.tanhua.server.config;

import com.tanhua.commons.utils.Constants;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class AnalysisTask {
    @Autowired
    private RedisTemplate<String, String> redisTemplate;

    /**
     * 配置时间规则
     */
    @Scheduled(cron = "0 0 0 * * ? ")
    public void analysis() {
        //  log.info("zs......................................");
        //业务逻辑
        redisTemplate.delete(Constants.SEND_CALL_KEY);
        redisTemplate.delete(Constants.RECEIVE_CALL_KEY);

    }
}